D2D communication is a technology that allows communication to be performed directly between terminals by applying available resources, which can reduce transmit power of a terminal, reduce load of a base station, and solve a problem of spectrum resource shortage of a wireless communications system to some extent. Currently, for D2D communication, there is a D2D communication mode independent of a network. In this communication mode, a terminal may work on a license-exempt band. The terminal autonomously finds available resources around by scanning, and performs neighboring terminal discovery and a data transmission process.
The D2D communication independent of a network may be applied in a public security scenario. For example, the public security scenario may be that a cellular network cannot work normally in an earthquake or emergency situation. Because no network participates in the D2D communication independent of a network, a terminal can discover a neighboring terminal in time, so that a terminal outside the earthquake or emergency situation can communicate with a terminal in the earthquake or emergency situation, which is helpful in implementing timely rescue. However, this communication mode cannot meet a requirement that a network can be controlled.